#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "structs.h"

void addVertex(Network* net, char* verName);
void printDegree(Network* net, int id);
void addEdge(Network* net, int firstID, int secondID, double weight); /*G: new arg*/
void removeEdge(Network* net, int firstVertexID, int secondVertexID);
void idByName(Network* net, char* name);
void print(Network* net);
void cluster (Network* net, int numOfClusters);
void quit(Network* net);


/*--- GIL ---*/

void main_engine(Network* net, char **argv); /* G:*/

/*Parsing mechanism*/
void handle_user_input(char** argv);
void build_network(Network *net);

int number_of_parameters(char *input);
char* get_next_parameter(char *input, char* parameter);
int get_id(Network* net, char* name);

/* Input check */
int check_only_whitespace(Network* net, char *input);
int whitespace_shift(char *input);
int char_to_int(Network* net, char* number, int op);
double char_to_double(Network* net, char* number);
int str_vs_int(char* str, int num);

/* secure programming */
int sec_print(Network* net, char* str);

/*TESTING ZONE*/
void create_objective_array(int number_of_clusters);
int allocation_verifier(int* array);
void build_constraint_memory(int number_of_clusters);
void print_constraints(edge_iterator *edge_iter, vertex_iterator *ver_iter, char *sense, double *rhs, int *matbeg, int *matcnt, int *matind,	int *matval, int number_of_clusters);
void qa1(int op, int number_of_constraints, int beg_size, int ind_size, int *matbeg, int *matcnt, int *matind, int* matval, char *sense, double *rhs);